{include file='public/_meta'}
<title>火化炉管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基础信息管理 <span class="c-gray en">&gt;</span> 火化炉管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
		<form class="Huiform" method="post" action="index.html" target="_self">
			<input type="text" class="input-text" style="width:250px" placeholder="火化炉名称" id="keywords" name="keywords">
			<button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜火化炉</button>
		</form>
	</div>
  <div class="cl pd-5 bg-1 bk-gray mt-20" style="margin-bottom: 10px;"> 
      <span class="l">
          <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> 
          <a href="javascript:;" onclick="admin_hhl_add('添加火化炉','add.html','370','370')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加火化炉</a>
      </span> <span class="r">共有数据：<strong>{$totalcounts}</strong> 条</span> </div>
	<table class="table table-border table-bordered table-bg table-sort">
		<thead>
			<tr>
				<th scope="col" colspan="7">火化炉</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th width="40">ID</th>
				<th>火化炉</th>
				<th width="80">炉数</th>
				<th width="80">组数</th>
				<th width="100">单价</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
        {foreach $list as $k=>$v}
			<tr class="text-c">
				<td><input type="checkbox" value="{$v.id}" name=""></td>
                <td>{$v.id}</td>
				<td>{$v.title}</td>
				<td>{$v.ls}</td>
				<td>{$v.zs}</td>
				<td>{$v.price}</td>
				<td>
					<a title="编辑火化炉" href="javascript:;" onclick="admin_hhl_edit('编辑火化炉','<?php echo url('admin/hhl/edit',['id'=>$v['id']]);?>','370','370')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
					<a title="删除" href="javascript:;" onclick="admin_hhl_del(this,'{$v.id}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
				</td>
            </tr>
        {/foreach}
		</tbody>
	</table>
</div>
<!--_footer 作为公共模版分离出去-->
{include file='public/_footer'}
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__PUBLIC__lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__PUBLIC__lib/jquery.treetable.js"></script>
<script type="text/javascript">
//$(function(){
	$('.table-sort').dataTable({
		"aaSorting": [[ 1, "asc" ]],//默认第几个排序
		//"bStateSave": true,//状态保存
		"aoColumnDefs": [
		//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		{"orderable":false,"aTargets":[0,4]}// 制定列不参与排序
		],
        language : {
            "sProcessing": "处理中...",
            "sLengthMenu": "显示 _MENU_ 项结果",
            "sZeroRecords": "没有匹配结果",
            "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
            "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
            "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
            "sInfoPostFix": "",
            "sSearch": "搜索：",
            "sUrl": "",
            "sEmptyTable": "表中数据为空",
            "sLoadingRecords": "载入中...",
            "sInfoThousands": ",",
            "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "上页",
                "sNext": "下页",
                "sLast": "末页"
            },
            "oAria": {
                "sSortAscending": ": 以升序排列此列",
                "sSortDescending": ": 以降序排列此列"
            }
        }
	});
//});
/*
	参数解释：
	title	标题
	url		请求的url
	id		需要操作的数据id
	w		弹出层宽度（缺省调默认值）
	h		弹出层高度（缺省调默认值）
*/
/*管理员-火化炉-添加*/
function admin_hhl_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*管理员-火化炉-编辑*/
function admin_hhl_edit(title,url,w,h){
	layer_show(title,url,w,h);
}

/*管理员-火化炉-删除*/
function admin_hhl_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.getJSON("delete.html",{'ids':id},function(res){
				if(parseInt(res.statusCode)==200){
					$(obj).parents("tr").remove();
					layer.msg(res.message,{icon:1,time:1000});
					window.location.reload();
				}else{
					layer.msg(res.message);			
				}
		});		
	});
}

function datadel(){
	var gid = '';
	layer.confirm('确定要执行该批量操作吗？',function(){
			$("input:checkbox").each(function(index){
				if($(this).is(':checked')==true){				
					var id = $(this).val();
					if(id){
						gid += id+','
					}
				}
			});
			gid = gid.substring(0,gid.length-1);
			if(gid==''){
				layer.msg("请选择要操作的项");
			}else{
				// 由于需要JSON数据，所以使用$.getJSON
				$.getJSON("{:url('admin/hhl/delete')}", { 'ids': gid }, function(res){
					layer.msg(res.message,{icon:1,time:1000});
					window.location.reload();
				});
			}
	});
	
}
</script>
</body>
</html>